/**
 * <p>Copyright (c) 2011 深圳市鹏途信息技术有限公司 </p>
 * <p>				   All right reserved. 		     </p>
 * 
 * <p>项目名称 ： 	东莞交通工程质量监督综合业务系统        </p>
 * <p>创建者   :	Administrator 
 * 
 * <p>描   述  :   LuceneAction.java for com.pengtu.web    </p>
 * 
 * <p>最后修改 : $: 2011-9-14-上午11:49:51 v 1.0.0	 Administrator   $     </p>
 * 
*/

package com.pengtu.web.lucene;

import org.springframework.beans.factory.annotation.Autowired;

import com.pengtu.service.lucene.LuceneManager;
import com.pengtu.utils.web.Struts2Utils;
import com.pengtu.web.BaseActionSupport;


/**
 * 
 * LuceneAction
 * 
 * 2011-9-14 上午11:49:51
 * 
 * @version 1.0.0
 * 
 */
public class LuceneAction extends BaseActionSupport<Object>{

	/**
	 * serialVersionUID:TODO
	 *
	 * @since 1.0.0
	 */
	
	private static final long serialVersionUID = 1L;
	private LuceneManager luceneManager;
	@Autowired
	public void setLuceneManager(LuceneManager luceneManager) {
		this.luceneManager = luceneManager;
	}

	private String keyword;
	private String id;
	private String type;
	
	public String createLucene() throws Exception{
		String fileClassPath = Struts2Utils.getAppRootPath();
		String index = "D://index";
		luceneManager.createIndexByLucene(fileClassPath, index);
		return "lucene";
	}
	
	public String searchLucene(){
		if(keyword != null && !keyword.equals("")){
			luceneManager.searchLucene(keyword,type);
			}
		return "lucene";
	}

	public String getKeyword() {
		return keyword;
	}

	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Override
	public Object getModel() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String list() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String input() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String save() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String delete() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected void prepareModel() throws Exception {
		// TODO Auto-generated method stub
		
	}
	
	
}
